import axios from '~/axios'

/**
 * 列表查询
 * @param {*} paramIo 
 */
export function api_cert_list(paramIo) {
    return axios({
        url: '/official/backend/cert/list',
        method: 'post',
        data: paramIo
    })
}

/**
 * 新增
 * @param {*} paramIo 
 */
export function api_cert_add(paramIo) {
    return axios({
        url: '/official/backend/cert/add',
        method: 'post',
        data: paramIo
    })
}

/**
 * 修改
 * @param {*} paramIo 
 */
export function api_cert_update(id,paramIo) {
    paramIo.id = id
    return axios({
        url: '/official/backend/cert/update',
        method: 'post',
        data: paramIo
    })
}

/**
 * 上架|下架
 * @param {*} paramIo 
 */
export function api_cert_changeState(id,state) {
    return axios({
        url: '/official/backend/cert/changeState/'+id+"/"+state,
        method: 'post'
    })
}


// 证书申请管理


/**
 * 申请列表查询
 * @param {*} paramIo 
 */
export function api_cert_apply_list(paramIo) {
    return axios({
        url: '/official/backend/cert/apply/list',
        method: 'post',
        data: paramIo
    })
}

/**
 * 根据ID查询申请信息
 * @param {*} paramIo 
 */
export function api_cert_apply_id(applyId) {
    return axios({
        url: '/official/backend/cert/apply/'+applyId,
        method: 'post'
    })
}

/**
 * 信息录入
 * @param {*} paramIo 
 */
export function api_cert_apply_enterInfo(paramIo) {
    return axios({
        url: '/official/backend/cert/apply/enterInfo',
        method: 'post',
        data: paramIo
    })
}

/**
 * 提交审批结果
 * @param {*} paramIo 
 */
export function api_cert_apply_audit(paramIo) {
    return axios({
        url: '/official/backend/cert/apply/audit',
        method: 'post',
        data: paramIo
    })
}

/**
 * 申请列表Look
 * @param {*} paramIo 
 */
export function api_cert_apply_look_list(paramIo) {
    return axios({
        url: '/official/backend/cert/applyLook/list',
        method: 'post',
        data: paramIo
    })
}

/**
 * 根据证书申请ID获取审批流信息
 * @param {} applyId 
 * @returns 
 */
export function getRequestInfoByCertApplyId(applyId) {
    return axios({
        url: "/api/backend/approval/request/getRequestInfo/"+applyId,
        method: 'post'
    })
}


/**
 * 录入已有证书
 * @param {*} paramIo 
 * @returns 
 */
export function api_cert_apply_enterCert(paramIo) {
    return axios({
        url: "/official/backend/cert/apply/enterCert",
        method: 'post',
        data: paramIo,
        headers: {
            'Content-Type':'multipart/form-data'
        }
    })
}

/**
 * 生成预览文件
 * @param {*} paramIo 
 * @returns 
 */
export function api_cert_apply_certPreview(applyId) {
    return axios({
        url: "/official/backend/cert/apply/certPreview/"+applyId,
        method: 'post'
    })
}

/**
 * 删除录入已有证书
 * @param {*} paramIo 
 * @returns 
 */
export function api_cert_apply_enterCert_delete(applyId) {
    return axios({
        url: "/official/backend/cert/apply/enterCert/delete/"+applyId,
        method: 'post'
    })
}
/**
 * 手动录入证书
 * @param {*} paramIo 
 * @returns 
 */
export function api_manualEn(paramIo){
    return axios({
        url:"/official/backend/cert/manualEn",
        method:'post',
        data:paramIo
    })
}

/**
 * 手动更新证书
 * @param {*} paramIo 
 * @returns 
 */
export function api_updateEnCert(paramIo){
    return axios({
        url:"/official/backend/cert/updateEnCert",
        method:'post',
        data:paramIo
    })
}

/**
 * 手动上传证书
 * @param {*} paramIo 
 * @returns 
 */
export function api_uploadEnCert(paramIo){
    return axios({
        url:"/official/backend/cert/uploadEnCert",
        method:'post',
        data:paramIo,
        headers: {
      'Content-Type':'multipart/form-data'
    },
    })
}

/**
 * 信息录入
 * @param {*} paramIo 
 */
export function api_cert_apply_updatePersonalInfo(paramIo) {
    return axios({
        url: '/official/backend/cert/apply/updatePersonalInfo',
        method: 'post',
        data: paramIo
    })
}